# 作者：20201310
import math
def operation1(c, operator1):
    if operator1 == 'sin':
        return math.sin(c)
    if operator1 == 'cos':
        return math.cos(c)
def operation(a, b, operator):
    if operator == '-':
        return a - b
    if operator == '+':
        return a + b
    if operator == '/':
        return a / b
    if operator == '*':
        return a * b
    if operator == '//':
        return a // b
    if operator == "%":
        return a % b
    if operator == '**':
        return a ** b
flag = 1
while flag == 1:
    operator = input("请输入你要进行的运算：（+、-、*、/、//、%、**、sin、cos、+++):")
    if operator == 'sin' or operator == 'cos':
        c = int(input("请输入一个数c:"))
        print(operator + '%d=' % c, operation1(c, operator))
    elif operator == '+++':
        flag1 = 2
        sum = int(input("请输入一个数a:"))
        while flag1 == 2:
            b = int(input("请输入一个数b:"))
            sum = sum+b
            flag1 = int(input("请输入是继续加法（2）还是退出（0）："))
        print("sum = " ,sum)
    else:
        a = int(input("请输入一个数a:"))
        b = int(input("请输入一个数b:"))
        if operator == '-':
            print("%d" % a + operator + "%d=" % b, operation(a, b, operator))
        elif operator == '+':
            print("%d" % a + operator + "%d=" % b, operation(a, b, operator))
        elif operator == '/':
            print("%d" % a + operator + "%d=" % b, operation(a, b, operator))
        elif operator == '*':
            print("%d" % a + operator + "%d=" % b, operation(a, b, operator))
        elif operator == '//':
            print("%d" % a + operator + "%d=" % b, operation(a, b, operator))
        elif operator == '%':
            print("%d" % a + operator + "%d=" % b, operation(a, b, operator))
        elif operator == '**':
            print("%d" % a + operator + "%d=" % b, operation(a, b, operator))
    flag = int(input("请输入是继续（1）还是退出（0）："))